#include "../include/MySQLConnector.h"
#include "../include/Logger.h"
#include <string>
#include <iostream>

using std::cout;
using std::endl;

// g++ mysql.cc ../src/MySQLConnector.cc ../src/Configuration.cc ../src/Logger.cc -lmysqlclient -llog4cpp
int main() {
    MySQLConnector* connector = MySQLConnector::getInstance();

    string selectQuery = "SELECT * FROM users";
    auto result = connector->executeQuery(selectQuery);

    if (result) {
        MYSQL_ROW row;

        while ((row = mysql_fetch_row(result.get()))) {
            cout << "ID: " << row[0] << ", Name: " << row[1] << endl;
        }

        /* mysql_free_result(result); */
    }

    return 0;
}
